#! python3
# print a Table

tableData = [['apples', 'oranges', 'cherries', 'banana'],
             ['Alice', 'Bob', 'Carol', 'David'],
             ['dogs', 'cats', 'moose', 'goose']]

def printTable(data):
    maxLen = []
    for i in range(len(data)):
        lenList = []
        for j in range(len(data[i])):
            lenList += [len(data[i][j])]
        maxLen += [max(lenList)]
    
    for j in range(len(data[0])):
        for i in range(len(data)):
            print(data[i][j].rjust(maxLen[i] + 1), end='')
        print()

printTable(tableData)